//
//  AXBoundVC.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/13.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXBoundVC.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "AXLoginViewController.h"
#import "HBDNavigationController.h"
#import "UIViewController+HBD.h"
#import "ZXAccomplishFindPasswordVC.h"

@interface AXBoundVC ()
/** title */
@property (nonatomic ,strong) UILabel *titleLabel;

/**  微信号*/
@property (nonatomic, strong) UILabel *label1;
@property (nonatomic ,strong) UITextField *sjTextField;

/** 手机号 */
@property (nonatomic ,strong) UILabel *label2;
@property (nonatomic ,strong) UITextField *yzmTextField;

/** 验证码 */
@property (nonatomic ,strong) UILabel *label3;
@property (nonatomic ,strong) UITextField *passwordTextField;

/** 支付密码 */
@property (nonatomic ,strong) UILabel *label4;
@property (nonatomic ,strong) UITextField *password2TextField;

/** 确定按钮 */
@property (nonatomic ,strong) UIButton *sureButton;

@end

@implementation AXBoundVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    //客服按钮
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    backBtn.frame = CGRectMake(0, 0, 30, 30);
    [backBtn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = rightItem;
    
    /** 搜索 */
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 30)];
    self.titleLabel.text = @"添加银行卡号";
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:25];
    self.titleLabel.textColor = [UIColor colorWithHex:0x29b566];
    self.navigationItem.titleView = self.titleLabel;
    
    [self creatView];
    [self setlayout];
}

- (void)creatView {
    
    
    
    /** 手机号码Imageview */
    self.label1 = [[UILabel alloc]init];
    self.label1.text = @"姓名";
    self.label1.font = FONT_FOURTEEN;
    self.label1.textColor = COLOR_DIV;
    [self.view addSubview:self.label1];
    
    /** 手机号码TextField */
    self.sjTextField = [[UITextField alloc]init];
    self.sjTextField.textColor = [UIColor colorWithHex:0x999999];
    self.sjTextField.cornerRadius = 10;
    self.sjTextField.backgroundColor = [UIColor colorWithHex:0xf8f8f8];
    self.sjTextField.placeholder = @" 请输入姓名";
    [self.view addSubview:self.sjTextField];
    
  
    /** 验证码mageview */
    self.label2 = [[UILabel alloc]init];
    self.label2.text = @"银行卡号";
    self.label2.font = FONT_FOURTEEN;
    self.label2.textColor = COLOR_DIV;
    [self.view addSubview:self.label2];
    
    /** 验证码TextField */
    self.yzmTextField = [[UITextField alloc]init];
    self.yzmTextField.cornerRadius = 10;
    self.yzmTextField.placeholder = @"请输入本人银行卡号";
    self.yzmTextField.backgroundColor = [UIColor colorWithHex:0xf8f8f8];
    self.yzmTextField.textColor = [UIColor colorWithHex:0x999999];
    [self.view addSubview:self.yzmTextField];
    
    /** 请输入密码Imageview  */
    self.label3 = [[UILabel alloc]init];
    self.label3.text = @"开户号";
    self.label3.font = FONT_FOURTEEN;
    self.label3.textColor = COLOR_DIV;
    [self.view addSubview:self.label3];
    /** 请输入密码TextField */
    self.passwordTextField = [[UITextField alloc]init];
    self.passwordTextField.cornerRadius = 10;
    self.passwordTextField.placeholder = @" 请输银行开户号";
    self.passwordTextField.backgroundColor = [UIColor colorWithHex:0xf8f8f8];
    self.passwordTextField.textColor = [UIColor colorWithHex:0x999999];
    [self.view addSubview:self.passwordTextField];
    
    /** 请再次输入密码Imageview */
    self.label4 = [[UILabel alloc]init];
    self.label4.text = @"手机号";
    self.label4.font = FONT_FOURTEEN;
    self.label4.textColor = COLOR_DIV;
    [self.view addSubview:self.label4];
        /** 请再次输入密码TextField */
    self.password2TextField = [[UITextField alloc]init];
    self.password2TextField.cornerRadius = 10;
    self.password2TextField.placeholder = @" 请输入银行预留手机号";
    self.password2TextField.backgroundColor = [UIColor colorWithHex:0xf8f8f8];
    self.password2TextField.textColor = [UIColor colorWithHex:0x999999];
    [self.view addSubview:self.password2TextField];
    
    /** 确定按钮 */
    self.sureButton = [[UIButton alloc]init];
    [self.sureButton addTarget:self action:@selector(sure:) forControlEvents:UIControlEventTouchUpInside];
    self.sureButton.backgroundColor = [UIColor colorWithHex:0x3bde72];
    [self.sureButton setTitle:@"确定" forState:UIControlStateNormal];
    [self.sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.sureButton.cornerRadius = 10;
    [self.view addSubview:self.sureButton];
    
}

- (void)setlayout {
    
    
    
    /** 手机号码imageview*/
    self.label1.sd_layout
    .leftSpaceToView(self.view, 50)
    .topSpaceToView(self.view, 84)
    .widthIs(70)
    .heightIs(30);
    /** 手机号码TextField*/
    self.sjTextField.sd_layout
    .leftSpaceToView(self.label1, 10)
    .topSpaceToView(self.view, 84)
    .widthIs(SCREEN_WIDTH-180)
    .heightIs(30);

    /** 请输入验证码imageview*/
    self.label2.sd_layout
    .leftSpaceToView(self.view, 50)
    .topSpaceToView(self.label1, 10)
    .widthRatioToView(self.label1, 1)
    .heightRatioToView(self.label1, 1);
    /** 请输入验证码TextField*/
    self.yzmTextField.sd_layout
    .leftSpaceToView(self.label2, 10)
    .topSpaceToView(self.label1, 10)
    .widthRatioToView(self.sjTextField, 1)
    .heightRatioToView(self.sjTextField, 1);
    
    /** 请输入密码imageview*/
    self.label3.sd_layout
    .leftSpaceToView(self.view, 50)
    .topSpaceToView(self.label2, 10)
    .widthIs(70)
    .heightIs(30);
    /** 请输入密码TextField*/
    self.passwordTextField.sd_layout
    .leftSpaceToView(self.label3, 10)
    .topSpaceToView(self.label2, 10)
    .widthIs(SCREEN_WIDTH-180)
    .heightIs(30);
    
    /** 请再次输入密码imageview*/
    self.label4.sd_layout
    .leftSpaceToView(self.view, 50)
    .topSpaceToView(self.label3, 10)
    .widthIs(70)
    .heightIs(30);
    /** 请再次输入密码TextField*/
    self.password2TextField.sd_layout
    .leftSpaceToView(self.label4, 10)
    .topSpaceToView(self.passwordTextField,10)
    .widthIs(SCREEN_WIDTH-180)
    .heightIs(30);
    
    /** 登录*/
    self.sureButton.sd_layout
    .leftSpaceToView(self.view, 70)
    .topSpaceToView(self.password2TextField, 40)
    .widthIs(SCREEN_WIDTH -140)
    .heightIs(30);
    
    
}

#pragma mark - Action

- (void)back:(UIButton *)btn {
    AXLoginViewController *logVC = [[AXLoginViewController alloc]init];
    logVC.hbd_barHidden = YES;
    [self.navigationController pushViewController:logVC animated:YES];
}

/** 确定按钮的事件 */

- (void)sure:(UIButton *)btn {
    
    ZXAccomplishFindPasswordVC *comVC = [[ZXAccomplishFindPasswordVC alloc]init];
    //resVC.hbd_barHidden = YES;
    comVC.hbd_barAlpha = 0;
    [self.navigationController pushViewController:comVC animated:YES];
}

- (void)hqyzm:(UIButton *)btu {
    
}


@end
